<%@ page language="java" %>

<%@ page import="com.scalar.chiptrack.utils.ConfigManager,
				 com.scalar.chiptrack.commons.Constants,
				 com.scalar.chiptrack.users.Functionality,
				 com.scalar.chiptrack.users.User"%>

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-nested.tld" prefix="nested" %>
<%@ taglib uri="/WEB-INF/chiptrack-tags.tld" prefix="chiptrack" %>

<chiptrack:checkLogon sourcePage="/assmRelease.do" />
<%String chipTracContext = "/" + ConfigManager.getChipTracContext(); %>

<HTML>
<HEAD><TITLE>Scalarsoft - ChipTrac</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<LINK href="<%=chipTracContext%>/jsp/includes/stylesheets/scalarsoft.css" type="text/css" rel="stylesheet"></HEAD>
<script src="<%=chipTracContext%>/jsp/includes/scripts/functions.js"></script>
<script src="<%=chipTracContext%>/jsp/includes/scripts/validations.js"></script>
<SCRIPT language="JavaScript">

var noOfFabLots = 0;
function submitAddMore()
{
	document.assmReleaseForm.action = '<%=chipTracContext%>/assmRelease.do?action=addmore';
}

var dateElement = "";
function openCalendar( dateValue )
{
    dateElement = dateValue;
    newWindow = window.open('<%=chipTracContext%>/jsp/includes/calendar.html','optionsPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=no,width=180,height=440,resizable=no');
    newWindow.focus();
}

function assignDate( passedValue )
{
    dateElement.value=passedValue;
    window.focus();
}

function submitPage()
{
    var lotListSize = document.assmReleaseForm.lotListSize.value;
    var errors = '';
    var temp = document.assmReleaseForm.assmReleaseDate;
    var fileCtrl = document.assmReleaseForm.attachmentFile;

    if( chkDate(temp.value.trim(),"Release Date ","Y") == false)
    {
        errors = errMsg;
        temp.select();
        temp.focus();
    }

    if( document.assmReleaseForm.poNumber.value == '' )
    {
		errors = errors + "<li> Please enter PO Number";
        document.assmReleaseForm.poNumber.focus();
    }

    if ( fileCtrl.value.trim() != "" )
    {
        errors = errors + "<li>  Please click 'Attach' link to add the selected File";
        window.scrollTo(0,0);
    }

    var commentsLength = document.assmReleaseForm.comments.value.length;
    if( commentsLength > 200 )
    {
        errors = errors + "<li> Comments Should be Maximum of 200 Characters";
        document.assmReleaseForm.comments.select();
        document.assmReleaseForm.comments.focus();
    }
    var lotSelected = false;
    var lotQtyPulled = 0;

    for( var i=0; i< lotListSize;i++ )
    {
        if( document.assmReleaseForm.status.value == 'Closed' || document.assmReleaseForm.status.value == 'CLOSED' )
        {
            document.assmReleaseForm[ 'releaseLotList[' + i + '].selected' ].disabled = false;
        }
        else if ( document.assmReleaseForm[ 'releaseLotList[' + i + '].selected' ].disabled == true )
        {
            document.assmReleaseForm[ 'releaseLotList[' + i + '].selected' ].disabled = false;
        }
        if( document.assmReleaseForm[ 'releaseLotList[' + i + '].selected' ].checked == true )
        {
            lotSelected = true;
            if(document.assmReleaseForm['releaseLotList['+ i +'].qtyPulled'].value <= 0 )
            {
                errors = errors +  "<li> Please Enter the Valid Qty Pulled in Lot Information";
            }
            if( (eval(document.assmReleaseForm['releaseLotList['+ i +'].qtyPulled'].value) >  eval(document.assmReleaseForm['releaseLotList['+ i +'].qtyAvailable'].value)) && (document.assmReleaseForm['releaseLotList['+ i +'].lotNumber'].value != '') )
            {
                errors = errors +  "<li> The Quantity Pulled can not be Greater than Quantity Available for Lot "+ document.assmReleaseForm['releaseLotList['+ i +'].lotNumber'].value ;
            }
            if(errors != '')
            {
                var pa=document.getElementById("errors");
                pa.innerHTML = errors;
                window.scrollTo(0,0);
                return;
            }
            lotQtyPulled = eval( lotQtyPulled ) + eval( document.assmReleaseForm['releaseLotList['+ i +'].qtyPulled'].value );
        }
    }

    document.assmReleaseForm.totalDieQtyPulled.value = lotQtyPulled;

    if( lotSelected == false )
    {
        errors = errors + '<li> Please select at least one Wafer Id from Lot Information';
    }
    <%
     if ( ConfigManager.generateTestRelease()  ) {
    %>
    if( typeof( document.assmReleaseForm.testLocation_id ) != 'undefined' && document.assmReleaseForm.testLocation_id.value == -1)
    {
		errors = errors + "<li> Please select a Test Location";
    }
    <% } %>
    if( document.assmReleaseForm['shippingContactInfo.vendorId'].value == -1 )
    {
		errors = errors + "<li> Please select a After Completion Vendor";
    }

    /*var email = document.assmReleaseForm['shippingContactInfo.email'];
    if( email.length )
    {
        var count = email.length;
        if( email[count-1].value.trim().length > 0 && !isValidEMailId (email[count-1]))
        {
            errors = errors + '<li> Please enter a valid email address for Shipping Address';
            email[count-1].select();
        }
    }
    else
    {
        if( email.value.trim().length > 0 && !isValidEMailId (email))
        {
            errors = errors + '<li> Please enter a valid email address for Shipping Address';
            email.select();
        }
    }*/
    if ( errors != '' )
    {
        var pa=document.getElementById("errors");
        pa.innerHTML = errors;
        window.scrollTo(0,0);
        return;
    }

    if( document.assmReleaseForm.bomPartsAvailable.value == "true" ) {
        if ( document.assmReleaseForm.bomLotAvailable.value == 'true' ) {
            //var totalDieQtyPulled = eval( document.assmReleaseForm.totalDieQtyPulled.value );
            var totalBOMDieQtyPulled = document.assmReleaseForm.totalBOMDieQtyPulled.value;
            <%--var bomQtyPerDie = <bean:write name="assmReleaseForm" property="bomQtyPerDie"/>;

            var diesPerPackage = document.assmReleaseForm.diesPerPackage.value;
            if ( +bomQtyPerDie <= 0 )
            {
                bomQtyPerDie = 1;
            }
            if ( totalBOMDieQtyPulled != Math.floor(((totalDieQtyPulled/diesPerPackage)*bomQtyPerDie) ) )
            {
                //errors = errors + '<li> Total Assembly Lot Die Quantity pulled must be equal to total BOM Die Quantity pulled';
                errors = errors + '<li>Total <bean:message key="label.operation.release.assm.BOMLot"/> Quantity pulled must be equal to <font color="blue">' + Math.floor(((totalDieQtyPulled/diesPerPackage)*bomQtyPerDie) ) + '</font>' ;
            }--%>
            if (totalBOMDieQtyPulled == "false") {
                errors = errors + "<li>Please pull the <bean:message key="label.operation.release.assm.BOMLot"/> quantity to match the total assembly build qty</li>";
            }
        } else {
            errors = errors + "<li> <bean:message key="label.operation.release.assm.BOMLot"/> Inventory not available";
        }
        if(errors != '') {
            var pa=document.getElementById("errors");
            pa.innerHTML = errors;
            window.scrollTo(0,0);
			location="#e1";
            return;
        }
    }
    document.assmReleaseForm.assmReleaseDate.disabled = false;
    document.assmReleaseForm.waferSize.diabled = false;
    
    //document.assmReleaseForm.testPONumber.disabled = false;
    document.assmReleaseForm.action = "<%=chipTracContext%>/assmRelease.do?action=save";
    document.assmReleaseForm.submit();
}


function openAuditTrail( releaseId, releaseNumber )
{
    newWindow=window.open('<%=chipTracContext%>/releaseAuditTrail.do?action=auditTrail&releaseId='+releaseId+'&releaseNumber='+releaseNumber+'&type=<%=Constants.LOCATION_TYPE_ASSEMBLY%>','releaseAuditTrailPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=600,height=700,left=100,top=50,resizable=yes');
    newWindow.moveTo(100,50);
    newWindow.focus();
}

function calculateRunningTotalsForAllWafers()
{

    calculateTotalPulledQty();

    if( document.assmReleaseForm.status.value == 'Closed' || document.assmReleaseForm.status.value == 'CLOSED' )
    {
        document.assmReleaseForm.assmReleaseDate.disabled = true;
        document.assmReleaseForm.poNumber.disabled = true;
        document.assmReleaseForm.waferMapOrInked.disabled = true;
        document.assmReleaseForm.requestType.disabled = true;
        /*document.assmReleaseForm.vendorContactPerson.disabled = true;
        document.assmReleaseForm.vendorContactPersonEmail.disabled = true;*/
        document.assmReleaseForm.checkAll.disabled = true;

        if( typeof( document.assmReleaseForm.testLocation_id ) != 'undefined' )
        {
            document.assmReleaseForm.testLocation_id.disabled = true;
        }

        //document.assmReleaseForm.testPONumber.disabled = true;
        document.assmReleaseForm.shipperId.disabled = true;
        document.assmReleaseForm.comments.disabled = true;
    }
}

function calculateRunningTotal( idx )
{
    var runningTotal = document.assmReleaseForm.runningTotal;
    var qtyPulledObj    = document.assmReleaseForm[ 'releaseLotList[' + idx + '].qtyPulled'];
    var qtyPulled       = qtyPulledObj.value;

    if( document.assmReleaseForm[ 'releaseLotList[' + idx + '].selected' ].checked == true )
    {
        qtyPulledObj.disabled = false;
        runningTotal.value = parseInt( runningTotal.value ) + parseInt( qtyPulled );
        checkIfAllWafersAreSelected();
    }
    else if( document.assmReleaseForm[ 'releaseLotList[' + idx + '].selected' ].checked == false )
    {
        qtyPulledObj.disabled = true;
        document.assmReleaseForm.checkAll.checked = false;
        runningTotal.value = parseInt( runningTotal.value ) - parseInt( qtyPulled );
    }
}

function calculateTotalPulledQty()
{
    var form                = document.assmReleaseForm;
    var releaseType         = form.requestType.value;
    var lotListSize         = form.lotListSize.value;
    var totalQtyPulled      = 0;
    var totalBuildQty       = 0;

    var totalLotBuildQty    = 0;
    var pervTotalQtyPulled  = form.runningTotal.value;
    var diesPerPackage = document.assmReleaseForm.diesPerPackage.value;

    for ( var fabLotIdx=0; fabLotIdx < noOfFabLots; fabLotIdx++ )
    {
       var fromIdx = parseInt( form['fabLot['+fabLotIdx+'].lotFromIdx'].value );
       var toIdx = form['fabLot['+fabLotIdx+'].lotToIdx'] != null ? parseInt(form['fabLot['+fabLotIdx+'].lotToIdx'].value) : lotListSize-1;
       var lotBuildQty    = 0;
       for( var k = (+fromIdx); k <= (+toIdx); k++ ) //for each fab Lot
       {
           var qtyPulledObj    = document.assmReleaseForm[ 'releaseLotList[' + k + '].qtyPulled'];
           var qtyAvailObj    = document.assmReleaseForm[ 'releaseLotList[' + k + '].qtyAvailable'];
           if( document.assmReleaseForm[ 'releaseLotList[' + k + '].selected' ].checked == true )
           {
               qtyPulledObj.disabled = false;
               var qtyPulled       = qtyPulledObj.value;
               if ( ( qtyPulledObj.value ).length > 0 )
               {
                   var buildQty;
                   totalQtyPulled += parseInt( (+qtyPulled) );
                   <%--<%
                 if ( !ConfigManager.calculateBuildQtyByLot()  )
                 {
                 %>--%>
                   buildQty  = Math.floor((+qtyPulled)/(+diesPerPackage) );
                   document.assmReleaseForm['buildQty'+k+''].value = (+buildQty);
                   totalBuildQty += parseInt( (+buildQty) );
                 <%--<%}
                 else
                 {
                 %>--%>
                     /*buildQty  = round((+qtyPulled)/(+diesPerPackage), 1 );
                     document.assmReleaseForm['buildQty'+k+''].value = (+buildQty);
                     lotBuildQty += (+buildQty);
                     form['fabLot['+fabLotIdx+'].buildQty'].value = Math.floor((+lotBuildQty) );*/
                 <%--<%} %>--%>
               }
               else
               {
                   totalQtyPulled += parseInt( 0 );
                   totalBuildQty += parseInt( 0 );
               }

           }
           else if( document.assmReleaseForm[ 'releaseLotList[' + k + '].selected' ].checked == false )
           {
                qtyPulledObj.disabled   = true;
                qtyPulledObj.value = qtyAvailObj.value;
                if (parseInt(document.assmReleaseForm['buildQty'+k+''].value ) > 0 )
                {
                    form['fabLot['+fabLotIdx+'].buildQty'].value = parseInt(form['fabLot['+fabLotIdx+'].buildQty'].value) - parseInt(document.assmReleaseForm['buildQty'+k+''].value );
                }    
                document.assmReleaseForm['buildQty'+k+''].value = 0;

                form.checkAll.checked = false;
           }

       }

    }

    /*for( var i = 0; i < lotListSize; i++ )
    {
        var qtyPulledObj    = document.assmReleaseForm[ 'releaseLotList[' + i + '].qtyPulled'];
        var qtyAvailObj    = document.assmReleaseForm[ 'releaseLotList[' + i + '].qtyAvailable'];
        var qtyPulled       = qtyPulledObj.value;
        if( document.assmReleaseForm[ 'releaseLotList[' + i + '].selected' ].checked == true )
        {
            qtyPulledObj.disabled = false;
            if ( ( qtyPulledObj.value ).length > 0 )
            {
                var buildQty;

                //buildQty  = Math.floor(qtyPulled/diesPerPackage );
                 totalQtyPulled += parseInt( qtyPulled );
                 buildQty  = Math.floor(qtyPulled/diesPerPackage );
                 document.assmReleaseForm['buildQty'+i+''].value = buildQty;
                 totalBuildQty += parseInt( buildQty );

            }
            else
            {
                totalQtyPulled += parseInt( 0 );
                totalBuildQty += parseInt( 0 );
            }
        }
        else if( document.assmReleaseForm[ 'releaseLotList[' + i + '].selected' ].checked == false )
        {
            qtyPulledObj.disabled   = true;
            qtyPulledObj.value = qtyAvailObj.value;
            document.assmReleaseForm['buildQty'+i+''].value = 0;
            form.checkAll.checked = false;
        }
    }*/
    
    checkIfAllWafersAreSelected();

    form.totalDieQtyPulled.value    = totalQtyPulled;
    
    form.runningTotal.value         = totalQtyPulled;
      
     <%--<%
        if ( !ConfigManager.calculateBuildQtyByLot()  )
        {
     %>--%>
        form.totalBuildQty.value         = totalBuildQty;
    <%--<%}
     else
     {
     %>--%>

        /*for ( var fabLotIdx=0; fabLotIdx < noOfFabLots; fabLotIdx++ )
        {
            totalLotBuildQty +=  parseInt(form['fabLot['+fabLotIdx+'].buildQty'].value);
        }
        form.totalBuildQty.value= totalLotBuildQty;*/
    <%--<%} %>--%>
    /*if(+pervTotalQtyPulled != +totalQtyPulled) {
        form.totalBOMDieQtyPulled.value = false;
    }*/
}

function openBomInventoryLotScreen()
{

    //Calculating Total Assembly Dies Pulled.
    var totalDieQtyPulled = 0;
    var lotListSize = document.assmReleaseForm.lotListSize.value;
    var wafersSelected = 'false';
    for( var i=0; i< lotListSize;i++ )
    {
        if( document.assmReleaseForm[ 'releaseLotList[' + i + '].selected' ].checked == true )
        {
            wafersSelected = 'true';
            totalDieQtyPulled = eval( totalDieQtyPulled ) + eval( document.assmReleaseForm['releaseLotList['+ i +'].qtyPulled'].value );
        }
    }

    document.assmReleaseForm.totalDieQtyPulled.value = totalDieQtyPulled;

    if( wafersSelected == 'false')
    {
        var pa=document.getElementById("errors");
        pa.innerHTML = '<li> Please select at least one Wafer Id from Lot Information';
        window.scrollTo(0,0);
        return;
    }
    if ( document.assmReleaseForm.bomLotAvailable.value != 'true' )
    {
        var pa=document.getElementById("errors");
        pa.innerHTML = '<li> <bean:message key="label.operation.release.assm.BOMLot"/> Inventory not available';
        window.scrollTo(0,0);
        return;
    }
    var totalBuildQty = document.assmReleaseForm.totalBuildQty.value;
    newWindow=window.open('<%=chipTracContext%>/assmRelease.do?action=loadAssemblyBomInventoryLotInfo&totalDieQtyPulled='+totalDieQtyPulled+'&totalBuildQty='+totalBuildQty,'releaseAuditTrailPopup','channelmode=no,directories=no,toolbar=no,menubar=no,personalbar=no,status=no,scrollbars=yes,width=700,height=400,left=100,top=50,resizable=yes');
    newWindow.moveTo(100,50);
    newWindow.focus();
}

function checkAllWafers( checkAll )
{
    var lotListSize = document.assmReleaseForm.lotListSize.value;
    var runningTotal = document.assmReleaseForm.runningTotal;
    runningTotal.value='0';
    if( checkAll.checked )
    {
        for( var i = 0; i < lotListSize; i++ )
        {
            if ( document.assmReleaseForm[ 'releaseLotList[' + i + '].selected'].disabled == false )
            {
                document.assmReleaseForm[ 'releaseLotList[' + i + '].selected' ].checked = true;
            }
            var qtyPulled = document.assmReleaseForm[ 'releaseLotList[' + i + '].qtyPulled'].value;
            runningTotal.value = parseInt(runningTotal.value) + parseInt(qtyPulled);
        }
    }
    else
    {
        for( var i = 0; i < lotListSize; i++ )
        {
            if ( document.assmReleaseForm[ 'releaseLotList[' + i + '].selected'].disabled == false )
            {
                document.assmReleaseForm[ 'releaseLotList[' + i + '].selected' ].checked = false;
            }
        }
    }
    calculateTotalPulledQty();
}

function checkIfAllWafersAreSelected()
{
    var lotListSize = document.assmReleaseForm.lotListSize.value;
    var selectedWafersCount = 0;
    for( var i = 0; i < lotListSize; i++ )
    {
        if( document.assmReleaseForm[ 'releaseLotList[' + i + '].selected' ].checked )
        {
            selectedWafersCount++;
        }
    }
    if( selectedWafersCount == lotListSize )
    {
        document.assmReleaseForm.checkAll.checked = true;
    }
}

function resetForm()
{
    document.assmReleaseForm.reset();
    calculateRunningTotalsForAllWafers();
}

function loadSelectedValues()
{
    var form        = document.assmReleaseForm;
    var actionType  = form.actionType.value;
    var lotListSize     = form.lotListSize.value;
    for( var i=0; i< lotListSize;i++ )
    {
        if( form.status.value == 'Closed' || form.status.value == 'CLOSED' )
        {
            document.assmReleaseForm[ 'releaseLotList[' + i + '].selected' ].disabled = false;
        }
    }
    form.assmReleaseDate.disabled   = false;
    //form.testPONumber.disabled      = false;
    form.refreshedByUser.value      = "true";
    form.action = "<%=chipTracContext%>/assmRelease.do?action=" + actionType;
    form.submit();
}

function attachFile()
{
    var form        = document.assmReleaseForm;
    var actionType  = form.actionType.value;
    var errors      = "";
    var fileCtrl    = form.attachmentFile;

    if ( fileCtrl.value.trim() == "" )
	{
      	errors =  errors + "<li>Please select a file to attach</li>";
        window.scrollTo(0,0);
    }
	var fileValue   = fileCtrl.value;
	fileValue       = fileValue.replace ( '/', '\\' );
	var position    = fileValue.lastIndexOf( '\\' );
	var poFileName  = fileValue.substr( ( position + 1 ) , fileValue.length );

	if( fileValue.indexOf( "'" ) >= 0 || fileValue.indexOf( "%" ) >= 0 )
	{
		errors =  errors + "<li>' + ' File name should not contain ' % characters";
        window.scrollTo(0,0);
	}

    if( errors != "" )
    {
        var pa=document.getElementById("errors");
        pa.innerHTML = errors;
        return;
    }
    else
    {

        form.assmReleaseDate.disabled       = false;
        form.fileNameWithLocalPath.value    = fileValue.trim();
        form.newAttachFile.value            = "true";
        form.refreshedByUser.value          = "true";
        form.action = "<%=chipTracContext%>/assmRelease.do?action=" + actionType;
        document.assmReleaseForm.submit();
    }
}

function detachFile()
{
    var form        = document.assmReleaseForm;
    var actionType  = form.actionType.value;
    var errors      = "";
    var fileCtrl    = form.attachmentFile;

    if( errors != "" )
    {
        var pa = document.getElementById("errors");
        pa.innerHTML = errors;
        return;
    }
    else
    {
        form.deleteAttachFile.value = "true";
        form.refreshedByUser.value  = "true";
        form.action = "<%=chipTracContext%>/assmRelease.do?action=" + actionType;
        document.assmReleaseForm.submit();
    }
}


</SCRIPT>

<BODY bgColor="#ffffff" leftMargin="0" topMargin="0" marginheight="0" marginwidth="0" onload="calculateRunningTotalsForAllWafers()">

<!-- Top Header Start-->
<%@ include file="/jsp/includes/header.jsp" %>
<!-- Top Header End-->

<table cellSpacing="0" cellPadding="0" width="100%" border="0">
    <tr>
	    <td width='180' valign='top' background='<%=chipTracContext%>/jsp/includes/images/left_red_bg.gif'>
            <!-- Side Navigation start -->
	        <%@ include file="/jsp/operations/releaseMenu.jsp" %>
	        <!-- end of the side navigations -->
        </td>
	    <td bgcolor="#ffffff"><img height="9" src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width="8"></td>
	    <td bgcolor="#ffffff"><img height="480" src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width="2"></td>
	    <td valign="top" width="70%">
            <img height="1" src="<%=chipTracContext%>/jsp/includes/images/clear.gif" width="500" border="0">
            <br>
			<%
				try{
			%>
            <html:form action="/assmRelease.do" enctype="multipart/form-data" method="post">
            <table width="70%" align="center" cellpadding="2" cellspacing="2" border="0">
                <tr>
                    <td colspan="4" class="NArialW" align="center">Assembly Release</td>
                </TR>
                <logic:equal name="showMessage" value="TRUE">
                <tr><td colspan="4" align='left'><font class='NArialS'color='blue'><b><%=Constants.NO_MODIFY_RIGHTS %></b></font></td></tr>
                </logic:equal>
                <tr><td colspan='4' align="left" class='NArialL'>&nbsp;<FONT id="errors" color='FF0000'>&nbsp;</font></td></TR>
                <tr><td colspan='4' class="NArialL"><chiptrack:errors styleClass="NArialL"/></td></tr>
			    <tr><td colspan='4' class="NArialL"><chiptrack:info styleClass="NArialL"/></td></tr>
                <tr><td colspan='4' class="NArialL">&nbsp;</td></tr>
				    <tr><td><a name="#e1"></a></td></tr>

                <tr>
                    <td colspan='4'>
                        <html:hidden name="assmReleaseForm" property="assmReleaseId"/>
                        <html:hidden name="assmReleaseForm" property="customerId"/>
                        <html:hidden name="assmReleaseForm" property="processStep_id"/>
                        <html:hidden name="assmReleaseForm" property="fromLocation_id"/>
                        <html:hidden name="assmReleaseForm" property="toLocation_id"/>
                        <html:hidden name="assmReleaseForm" property="totalDieQtyPulled"/>
                        <html:hidden name="assmReleaseForm" property="totalDieQtyToBuild"/>
                        <html:hidden name="assmReleaseForm" property="totalBOMDieQtyPulled"/>
                        <html:hidden name="assmReleaseForm" property="shippingAddress_id"/>
                        <html:hidden name="assmReleaseForm" property="status"/>
                        <html:hidden name="assmReleaseForm" property="diesPerPackage"/>
                        <html:hidden property="test" />
                        <html:hidden property="tapeReel" />                                                          
                        <html:hidden property="turnKey" />
                        <input type="hidden" name="refreshedByUser">
                        <input type="hidden" name="newAttachFile">
                        <input type="hidden" name="deleteAttachFile">
                        <input type="hidden" name="fileNameWithLocalPath">
                        <input type="hidden" name="actionType" value="<bean:write name="actionType"/>">
                    </td>
                </tr>
                <tr>
                    <td class="NArialL" width="20%">
                        <bean:message key="label.operation.release.assm.ReleaseNo"/>:<font color=red>*</font>
                    </td>
                    <td class="NArialL" width="18%">
                        <html:text name="assmReleaseForm" property="assmReleaseNo" styleClass="valuetxfield" maxlength='50' disabled="true"/>
                    </td>
                    <td class="NArialL" width="12%">
                        <bean:message key="label.operation.release.assm.ReleaseDate"/> :<font color=red>*</font>
                    </td>
                    <td class="NArialL" width="20%">
                        <html:text name="assmReleaseForm" property="assmReleaseDate" styleClass="txfield"/>
                        <logic:notEqual name="assmReleaseForm" property="status" value="Closed" >
                            <logic:notEqual name="assmReleaseForm" property="status" value="CLOSED" >
                                <a href="javascript:openCalendar( document.assmReleaseForm.assmReleaseDate )">
                                    <img onMouseOver="window.status='Click  to select date';return true" onMouseout="window.status='';return 	true" border="0" align='center' src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20>
                                </a>
                            </logic:notEqual>
                        </logic:notEqual>
                    </td>
                </tr>
                <tr>
                    <td class="NArialL">
                        Customer Name:
                    </td>
                    <td class="NArialL">
                        <bean:write name="assmReleaseForm" property="customerName"/>
                    </td>
                    <td class="NArialL">
                        <bean:message key="label.operation.release.assm.PONo"/>:<font color=red>*</font>
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="poNumber" styleClass="txfield" maxlength='50'/>
                    </td>
                </tr>
                <tr>
                    <td class="NArialL">
                        <bean:message key="label.operation.release.assm.partNumber"/> :
                    </td>
                    <td class="NArialL">
                        <html:hidden name="assmReleaseForm" property="waferMapOrInked"/>
                        <html:text name="assmReleaseForm" property="partNumber" styleClass="disabledtxfield" style="width:200px" disabled="true"/>
                    </td>
                    <td class="NArialL">
                        <bean:message key="label.operation.release.assm.mrktPartNumber" /> :
                    </td>
                    <td class="NArialL">

                        <html:select name="assmReleaseForm" property="marketingPartNumber" styleClass="txfield"  style="width:200px" >
                            <%--<html:option value="-1">-Select Mrkt Part Number-</html:option>--%>
                            <html:options collection="marketingPartNumbers" property="value" labelProperty="label"/>
                        </html:select>
                    </td>
                </tr>
                <tr>

                    <td class="NArialL">
                        Assembly Vendor:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="vendorName" styleClass="disabledtxfield" disabled="true"/>
                    </td>
                    <td class="NArialL">
                        Package Type:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="packageType" styleClass="txfield" maxlength='50' disabled="true"/>
                    </td>
                </tr>
                <tr>
                    <td class="NArialL">
                        Revision No:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="assmRevisionNumber" styleClass="txfield" maxlength='50' disabled="true"/>
                    </td>
                    <td class="NArialL">
                        Pin Count:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="pinCount" styleClass="txfield" maxlength='50' disabled="true"/>
                    </td>
                </tr>
                <tr>
                    <td class="NArialL">
                        Request Type:
                    </td>
                    <td class="NArialL">
                        <html:select name="assmReleaseForm" property="requestType" styleClass="txfield"  style="width:150px" disabled="true">
                            <html:option value="-1">--Select Req Type--</html:option>
                            <html:options collection="requestTypes" property="value" labelProperty="label"/>
                        </html:select>
                    </td>
                    <td class="NArialL">
                        TurnKey:
                    </td>
                    <td class="NArialL">
                        <html:checkbox property="turnKey" styleClass="txfield" disabled="true"/> &nbsp; <bean:write name="assmReleaseForm" property="turnKeyLabel" />
                    </td>
                 </tr>

                 <tr>
                    <td class="NArialL">
                        <bean:message key="label.operation.release.assm.waferMap"/> :
                    </td>
                    <td class="NArialL">
                        <html:select name="assmReleaseForm" property="waferMap" styleClass="txfield"  style="width:150px" >
                            <html:option value="-1">-Select Wafer Map-</html:option>
                            <html:options collection="waferMapDetails" property="value" labelProperty="label"/>
                        </html:select>
                    </td>

                    <td class="NArialL">
                        <bean:message key="label.operation.release.assm.assemblyBase"/> :
                    </td>
                    <td class="NArialL">
                        <html:select name="assmReleaseForm" property="assemblyBase" styleClass="txfield"  style="width:175px" >
                            <html:option value="-1">-Select Assembly Base-</html:option>
                            <html:options collection="assemblyBaseDetails" property="value" labelProperty="label"/>
                        </html:select>
                    </td>
                </tr>
                <tr>
                   <td class="NArialL">
                       <bean:message key="label.operation.release.assm.waferSize" /> :
                   </td>
                   <td class="NArialL">
                       <html:text name="assmReleaseForm" property="waferSize" styleClass="disabledtxfield" disabled="true"/>
                   </td>
                   <td class="NArialL">Back Grind Thickness :</td>
                   <td class="NArialL"><html:text name="assmReleaseForm" property="backGrindThickness" styleClass="disabledtxfield" disabled="true"/></td>
                </tr>
                <tr>

                    <td class="NArialL" width="12%">
                        <bean:message key="label.operation.release.assm.ReleaseShipmentDate"/> :
                    </td>
                    <td class="NArialL" width="20%">
                        <html:text name="assmReleaseForm" property="assyExpetedDateOut" styleClass="txfield"/>
                        <a href="javascript:openCalendar( document.assmReleaseForm.assyExpetedDateOut )">
                           <img onMouseOver="window.status='Click  to select date';return true" onMouseout="window.status='';return 	true" border="0" align='center' src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20>
                        </a>
                    </td>
                    <td class="NArialL">Marking :</td>
                    <td class="NArialL"><html:checkbox property="marking" styleClass="txfield"/></td>
                </tr>
                <tr>

                    <td class="NArialL" width="12%">
                        <bean:message key="label.operation.release.assm.userDefinedField1"/> :
                    </td>
                    <td class="NArialL" width="20%">
                        <html:text name="assmReleaseForm" property="userDefinedField1" styleClass="txfield"/>
                    </td>
                    <td class="NArialL"><bean:message key="label.operation.release.assm.userDefinedField2"/> :</td>
                    <td class="NArialL"><html:text name="assmReleaseForm" property="userDefinedField2" styleClass="txfield"/></td>
                </tr>
                <logic:equal value="0" name="vendorContListSize">
                    <tr><td colspan="4" class="NArialL"><font color="red">Contact Details not found</font></td></tr>
                </logic:equal>

                <tr><td colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <tr>
                    <td colspan="4" class="NArialL" width="70%"  align="left" bgcolor="#993333">
                        <font class="NArialL"><font color="#FFFFFF">Release Info Assembly Vendor Contact Details</font></font>
                    </td>
                </tr>
                <tr><td colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <tr>
                    <td class="NArialL">
                        Vendor Name:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="vendorName" styleClass="disabledtxfield" disabled="true"/>
                    </td>
                    <td class="NArialL">&nbsp;</td>
                    <td class="NArialL">&nbsp;</td>
                </tr>
                <bean:size id="vendorContListSize" name="vendorContactPersonList"/>
                <logic:greaterThan value="0" name="vendorContListSize">
                <logic:iterate name="vendorContactPersonList" id="vendorContactPerson" indexId="idIndex" type="com.scalar.chiptrack.operations.release.ContactPerson" >
                <tr>
                    <td class="NArialL">
                        Contact Person&nbsp;<%=idIndex.intValue()+1%>:
                    </td>
                    <td class="NArialL">
                        <html:text name="vendorContactPerson" property="name"  size="30" maxlength="50"  styleClass="txfield" disabled="true"/>
                    </td>
                    <td class="NArialL">
                        Contact Person Email&nbsp;<%=idIndex.intValue()+1%>:
                    </td>
                    <td class="NArialL">
                        <html:text name="vendorContactPerson" property="email" size="30" maxlength="50"  styleClass="txfield" disabled="true"/>
                    </td>
                </tr>
                </logic:iterate>
                </logic:greaterThan>
                <logic:equal value="0" name="vendorContListSize">
                    <tr><td colspan="4" class="NArialL"><font color="red">Contact Details not found</font></td></tr>
                </logic:equal>
                <bean:define id="fromVendorId" name="assmReleaseForm" property="fromLocation_id"/>
                <logic:notEqual name="assmReleaseForm" property="toLocation_id" value='<%=fromVendorId.toString()%>'>
                <tr><td colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <tr>
                    <td colspan="4" class="NArialL" width="70%"  align="left" bgcolor="#993333">
                        <font class="NArialL"><font color="#FFFFFF">Release Info Die Bank Vendor Contact Details</font></font>
                    </td>
                </tr>
                <tr><td colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <tr>
                    <td class="NArialL">
                        Vendor Name:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="fromVendorName" styleClass="disabledtxfield" disabled="true"/>
                    </td>
                    <td class="NArialL">&nbsp;</td>
                    <td class="NArialL">&nbsp;</td>
                </tr>
                <bean:size id="dbVendorContListSize" name="dieBankVendorContactPersonList"/>
                <logic:greaterThan value="0" name="vendorContListSize">
                <logic:iterate name="dieBankVendorContactPersonList" id="dbVendorContactPerson" indexId="idIndex" type="com.scalar.chiptrack.operations.release.ContactPerson" >
                <tr>
                    <td class="NArialL">
                        Contact Person&nbsp;<%=idIndex.intValue()+1%>:
                    </td>
                    <td class="NArialL">
                        <html:text name="dbVendorContactPerson" property="name"  size="30" maxlength="50"  styleClass="txfield" disabled="true"/>
                    </td>
                    <td class="NArialL">
                        Contact Person Email&nbsp;<%=idIndex.intValue()+1%>:
                    </td>
                    <td class="NArialL">
                        <html:text name="dbVendorContactPerson" property="email" size="30" maxlength="50"  styleClass="txfield" disabled="true"/>
                    </td>
                </tr>
                </logic:iterate>
                <tr>
                    <td class="NArialL">
                        Die Bank Ship Date:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="dbShipDate" styleClass="txfield"/>
                        <logic:notEqual name="assmReleaseForm" property="status" value="Closed" >
                            <logic:notEqual name="assmReleaseForm" property="status" value="CLOSED" >
                                <a href="javascript:openCalendar( document.assmReleaseForm.dbShipDate )">
                                    <img onMouseOver="window.status='Click  to select date';return true" onMouseout="window.status='';return 	true" border="0" align='center' src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20>
                                </a>
                            </logic:notEqual>
                        </logic:notEqual>
                    </td>
                    <td class="NArialL">&nbsp;</td>
                    <td class="NArialL">&nbsp;</td>
                </tr>
                <tr>
                    <td class="NArialL">
                        Die Bank Special Instructions:
                    </td>
                    <td class="NArialL" colspan="3">
                        <html:textarea name="assmReleaseForm" property="dbInstructions" styleClass="txfield" rows="4" cols="113"/>
                    </td>
                    <td class="NArialL">&nbsp;</td>
                    <td class="NArialL">&nbsp;</td>
                </tr>

                </logic:greaterThan>
                <logic:equal value="0" name="dbVendorContListSize">
                    <tr><td colspan="4" class="NArialL"><font color="red">Contact Details not found</font></td></tr>
                </logic:equal>
                </logic:notEqual>
                <tr><td colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <tr>
                    <td colspan="4" class="NArialL" width="70%"  align="left" bgcolor="#993333">
                        <font class="NArialL"><font color="#FFFFFF"><bean:message key="label.operation.release.internalContactPersons"/></font></font>
                    </td>
                </tr>
                <tr><td colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <bean:size id="contactPersonsSize" name="contactPersons"/>
                <logic:greaterThan value="0" name="contactPersonsSize">
                <logic:iterate name="contactPersons" id="contactPerson" indexId="idIndex" type="com.scalar.chiptrack.operations.release.ContactPerson" >
                <tr>
                    <td class="NArialL">
                        Contact Person&nbsp;<%=idIndex.intValue()+1%>:
                    </td>
                    <td class="NArialL">
                        <html:text name="contactPerson" property="name"  size="30" maxlength="50"  styleClass="txfield" disabled="true"/>
                    </td>
                    <td class="NArialL">
                        Contact Person Email&nbsp;<%=idIndex.intValue()+1%>:
                    </td>
                    <td class="NArialL">
                        <html:text name="contactPerson" property="email" size="30" maxlength="50"  styleClass="txfield" disabled="true"/>
                    </td>
                </tr>
                </logic:iterate>
                </logic:greaterThan>
                <logic:equal value="0" name="contactPersonsSize">
                    <tr><td colspan="4" class="NArialL"><font color="red">Contact Details not found</font></td></tr>
                </logic:equal>
                <logic:notEqual value="-1" name="assmReleaseForm" property="assmReleaseId">
                <tr><td colspan="4" class="NArialL" width="70%">&nbsp;</td></tr>
                <tr>
                    <td colspan="4" class="NArialL" width="70%">
                        Please Click here for <a href="javascript:openAuditTrail('<bean:write name="assmReleaseForm" property="assmReleaseId"/>','<bean:write name="assmReleaseForm" property="assmReleaseNo"/>')">Audit Trails</a>
                    </td>
                </tr>
                </logic:notEqual>
                <tr><td colspan='4'><IMG src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <tr bgcolor="#993333">
                    <td colspan='4' class="NArialL" align="left"><font color="#FFFFFF">Lot Information / Other</font></td>
                </tr>
                <tr>
                    <td width="70%" colspan='4' class="NArialL">
                        <table align="left" cellpadding="2" cellspacing="2" border="0">

                            <tr bgcolor="#993333">
                                <td align="center" class="NArialL"><input type="checkbox" name="checkAll" class='txfield' onclick='checkAllWafers(this);this.form.totalBOMDieQtyPulled.value = false;'></td>
                                <td align="center" class="NArialL"><font color="#FFFFFF">Wafer Id</font></td>
                                <td align="center" class="NArialL"><font color="#FFFFFF"><bean:message key="label.operation.release.assm.partNumber"/></font></td>
                                <td align="center" class="NArialL"><font color="#FFFFFF">Fab Lot Number</font></td>
                                <logic:equal value="TRUE" name="showDieBankLotNo">
                                <td align="center" class="NArialL"><font color="#FFFFFF">Die Bank Lot#</font></td>
                                </logic:equal>
                                <td align="center" class="NArialL"><font color="#FFFFFF"><bean:message key="label.operation.release.assm.shippedLotNo"/></font></td>
                                <td align="center" class="NArialL"><font color="#FFFFFF">Qty Available</font></td>
                                <td align="center" class="NArialL"><font color="#FFFFFF">Qty Pulled</font></td>
                                <td align="center" class="NArialL"><font color="#FFFFFF">Qty To Build</font></td>
                                <logic:equal value="TRUE" name="showScreenPrintOrder">
                                <td align="center" class="NArialL"><font color="#FFFFFF">Screen Print Order</font></td>
                                </logic:equal>
                                <logic:equal value="TRUE" name="showBackGrindOrder">
                                <td align="center" class="NArialL"><font color="#FFFFFF">Back Grind Order</font></td>
                                </logic:equal>
                            </tr>
                            <nested:size id='lotListSize' name='assmReleaseForm' property='releaseLotList'/>
                            <input type='hidden' name='lotListSize' value='<%=lotListSize%>'/>
                            <%
                                String prevLotNumber = "";
                                int noOfFabLots = 0;
                            %>
                            <nested:iterate name="assmReleaseForm" property="releaseLotList" id="lot" type="com.scalar.chiptrack.operations.release.ReleaseLot" indexId="idx">
                            <logic:notEqual value="<%=prevLotNumber%>" property="fabLotNumber" name="lot">
                            <logic:notEqual value="0" name="idx">
                                <input type="hidden" name="fabLot[<%=noOfFabLots-1%>].lotToIdx" value="<%=idx.intValue()-1%>"/>
                            </logic:notEqual>
                            <%
                                prevLotNumber = lot.getFabLotNumber();
                                noOfFabLots++;
                            %>
                             <input type="hidden" name="fabLot[<%=noOfFabLots-1%>].lotFromIdx" value="<%=idx.intValue()%>"/>
                             <input type="hidden" name="fabLot[<%=noOfFabLots-1%>].fabLotNumber" value="<nested:write property="fabLotNumber"/>"/>   
                             <input type="hidden" name="fabLot[<%=noOfFabLots-1%>].buildQty" value="0"/>
                            </logic:notEqual>
                            <% boolean disabled = false;%>
                            <nested:equal value="true" property="partialReceiveLot">
                             <% disabled = true; %>
                             </nested:equal>
                            <tr>
                                <td align="center">
                                    <nested:hidden property="lotId"/>
                                    <%
                                        String js = "calculateRunningTotal("+idx+")";
                                        String buildQtyLbl = "buildQty"+idx+"";
                                    %>

                                    <nested:checkbox property="selected" disabled="<%=disabled%>" styleClass="txfield"  onclick="javascript:calculateTotalPulledQty();this.form.totalBOMDieQtyPulled.value = false;"/>

                                    <nested:hidden property="newLot"/>
                                </td>
                                <td align="center">
                                    <nested:text property="waferId" styleClass="txfield" size="3" disabled='true'/>
                                </td>
                               <td align="center">
                                    <html:text name="assmReleaseForm" property="dieBankProductName" style="width:190px" styleClass="txfield" disabled='true'/>
                                </td>
                                
                                <td align="center">
                                    <nested:text property="fabLotNumber" styleClass="txfield" style="width:115px" disabled='true'/>
                                </td>
                                <logic:equal value="TRUE" name="showDieBankLotNo">
                                <td align="center">
                                    <nested:text property="lotNumber" styleClass="txfield" style="width:115px" disabled='true'/>
                                </td>
                                </logic:equal>
                                <td align="center">
                                    <nested:text property="shippedLotNumber" style="width:125px" styleClass="txfield"/>
                                </td>
                                <td>
                                    <nested:text property="qtyAvailable" styleClass="valuetxfield" size="10" disabled='true'/>
                                </td>
                                <td>
                                    <nested:text property="qtyPulled" styleClass="valuetxfield" size="10" disabled="true" onkeyup="javascript:calculateTotalPulledQty();" onkeypress="javascript:allowInteger()"/>
                                </td>
                                <td>
                                    <input type='text' name='<%=buildQtyLbl%>' class='valuetxfield' size="10" disabled value='0'/>
                                </td>
                                <logic:equal value="TRUE" name="showScreenPrintOrder">
                                <td align="center">
                                    <html:text name="assmReleaseForm" property="screenPrintOrder" styleClass="txfield" size="3" disabled='true'/>
                                </td>
                                </logic:equal>
                                <logic:equal value="TRUE" name="showBackGrindOrder">
                                <td align="center">
                                    <html:text name="assmReleaseForm" property="backGrindOrder" styleClass="txfield" size="3" disabled='true'/>
                                </td>
                                </logic:equal>
                             </tr>
                            </nested:iterate>
                            <tr>
                                <td colspan='5'/>
                                <td class='NArialL'>Running Total:</td>
                                <td><input type='text' name='runningTotal' class='valuetxfield' size="10" disabled value='0'/></td>
                                <td><input type='text' name='totalBuildQty' class='valuetxfield' size="10" disabled value='0'/></td>
                                <td colspan='2'/>
                            </tr>
                            <script type="text/javascript">
                                noOfFabLots = <%=noOfFabLots%>;
                            </script>
                        </table>
                    </td>
                </tr>
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <html:hidden name="assmReleaseForm" property="bomLotAvailable"/>
                <html:hidden name="assmReleaseForm" property="bomPartsAvailable"/>
                <logic:equal name="assmReleaseForm" property="bomPartsAvailable" value="true">
                <tr><td colspan='4' class="NArialL">
                    Please Click here to enter <a href="javascript:openBomInventoryLotScreen()" onmouseover="window.status='Click to <bean:message key="label.operation.release.assm.BOMLot"/> Lot Information';return true" onmouseout="window.status='';return true"><bean:message key="label.operation.release.assm.BOMLot" /> Lot Information</a>
                    </td>
                </tr>
                </logic:equal>
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <tr>
                    <td colspan="4" class="NArialL" width="70%"  align="left" bgcolor="#993333">
                        <font class="NArialL"><font color="#FFFFFF">File Upload</font></font>
                    </td>
                </tr>
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <!--////-->
                <tr>
                    <td class="NArialL">
                        Upload File:
                    </td>
                    <td colspan="2" class="NArialL">
                        <html:file property="attachmentFile" size="65" styleClass="txfield"/>
                    </td>
                    <td class="NArialL">
                        <a href="javascript:attachFile()" onMouseOver="window.status='Click to Attach a File';return true"onmouseout="window.status='';return true"><b>Attach</b></a>
                        &nbsp;&nbsp;&nbsp;&nbsp;
                        <logic:notEmpty name="assmReleaseForm" property="attachFile.fileName">
                        <a href="javascript:detachFile()" onMouseOver="window.status='Click to Detach a File';return true"onmouseout="window.status='';return true"><b>Detach</b></a>
                        </logic:notEmpty>
                    </td>
                </tr>
                <logic:notEmpty name="assmReleaseForm" property="attachFile.fileName">
                <nested:nest property="attachFile">
                <tr>

                    <td class="NArialL">Attached File:</td>

                    <nested:equal property="attachNewFile" value="true">
                    <td colspan="2" class="NArialL">
                        <a href="<nested:write property="fileWebPathEncoded"/>" target="_newWindow" onMouseOver="window.status='Please right-click & choose Save target as';return true"onmouseout="window.status='';return true" title="Please right-click & choose Save target as"><nested:write property="fileName"/></a>
                    </td>
                    <td class="NArialL">
                        &nbsp;
                    </td>
                    </nested:equal>
                    <nested:notEqual property="attachNewFile" value="true">
                    <td colspan="2" class="NArialL">
                        <a href="<nested:write property="fileWebPathEncoded"/>" target="_newWindow" onMouseOver="window.status='Please right-click & choose Save target as';return true"onmouseout="window.status='';return true" title="Please right-click & choose Save target as"><nested:write property="fileName"/></a>
                    </td>
                    <td class="NArialL">
                        &nbsp;
                    </td>
                    </nested:notEqual>
                </tr>
                </nested:nest>
                </logic:notEmpty>
                <%--///--%>
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <tr>
                    <td colspan="4" class="NArialL" width="70%"  align="left" bgcolor="#993333">
                        <font class="NArialL"><font color="#FFFFFF">Assembly Spec Information</font></font>
                    </td>
                </tr>
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <bean:size id="assmSpecFileListSize" name="attachedSpecFileOneList"/>
                <logic:greaterThan name="assmSpecFileListSize" value="0">
                <tr>
                    <td class="NArialL">
                        Select Spec File Name:
                    </td>
                    <td class="NArialL">
                       <%-- <logic:equal name="assmReleaseForm" property="requestType" value="PROD">
                            <html:select name="assmReleaseForm" property="fileAttachmentSpecFileId" styleClass="txfield" onchange="javascript:loadSelectedValues();" style="width:200px" disabled="true">
                                <html:option value="-1">--Select Spec File Name--</html:option>
                                <html:options collection="attachedSpecFileOneList" property="value" labelProperty="label"/>
                            </html:select>
                        </logic:equal>
                        <logic:notEqual name="assmReleaseForm" property="requestType" value="PROD">--%>
                            <html:select name="assmReleaseForm" property="fileAttachmentSpecFileId" styleClass="txfield" onchange="javascript:loadSelectedValues();" style="width:200px">
                                <html:option value="-1">--Select Spec File Name--</html:option>
                                <html:options collection="attachedSpecFileOneList" property="value" labelProperty="label"/>
                            </html:select>
                        <%--</logic:notEqual>--%>
                    </td>
                    <td class="NArialL">
                        <bean:message key="label.operation.release.assm.assmSpecFileRevNo"/>:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="assmSpecFileRevNo" styleClass="txfield" maxlength='50' disabled="true"/>
						<html:hidden name="assmReleaseForm" property="bomSpecFileName"/>
						<html:hidden name="assmReleaseForm" property="bomSpecFileRevNo"/>
						<html:hidden name="assmReleaseForm" property="markingSpecFileName"/>
						<html:hidden name="assmReleaseForm" property="markingSpecFileRevNo"/>
						<html:hidden name="assmReleaseForm" property="buildSpecFileName"/>
						<html:hidden name="assmReleaseForm" property="buildSpecFileRevNo"/>
                    </td>
                </tr>
                   
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></td></tr>
                <tr>
                    <td class="NArialL">
                        <bean:message key="label.operation.release.assm.diagramOne"/>:
                    </td>
                    <td class="NArialL">
                        &nbsp;<a href="<%=chipTracContext%><%=ConfigManager.getSpecFilePathContext()%><bean:write name="assmReleaseForm" property="specPhysicalFileNameEncoded"/>" target="_newWindow" onMouseOver="window.status='Please right-click & choose Save target as';return true"onmouseout="window.status='';return true" title="Please right-click & choose Save target as"><bean:write name="assmReleaseForm" property="physicalFileName"/></a>
                    </td>
                    <td class="NArialL">
                        &nbsp;<%--<bean:message key="label.operation.release.assm.diagramTwo"/>:--%>
                    </td>
                    <td class="NArialL">
                        &nbsp;<%--<a href="<%=chipTracContext%><%=ConfigManager.getSpecFilePathContext()%><bean:write name="assmReleaseForm"  property="ceramicSpecPhysicalFileNameEncoded"/>" target="_newWindow" onMouseOver="window.status='Please right-click & choose Save target as';return true"onmouseout="window.status='';return true" title="Please right-click & choose Save target as"><bean:write name="assmReleaseForm"  property="physicalCeramicFileName"/></a>--%>
                    </td>
                </tr>
                <%--<tr>
                    <td class="NArialL">
                        Assembly Spec:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="assmSpecFileName" styleClass="txfield" maxlength='50' disabled="true"/>
                    </td>

                    <td class="NArialL">
                        Assembly Spec Rev No:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="assmSpecFileRevNo" styleClass="txfield" maxlength='50' disabled="true"/>
                    </td>
                </tr>--%>

                </logic:greaterThan>
                <logic:equal name="assmSpecFileListSize" value="0">
                    <tr><td colspan="4" class="NArialL"><font color="red">Specification Information not found</font></td></tr>
                </logic:equal>
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></td></tr>
                <tr>
                    <td class="NArialL">
                        Assm Special Instructions:
                    </td>
                    <td class="NArialL" colspan="3">
                        <html:textarea name="assmReleaseForm" property="comments" styleClass="txfield" rows="4" cols="113"/>
                    </td>
                </tr>
                <%--<logic:equal name="assmReleaseForm" property="turnKey" value="true">--%>
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <tr>
                <td colspan="4" class="NArialL" width="70%"  align="left" bgcolor="#993333">
                    <font class="NArialL"><font color="#FFFFFF">Test Spec Information</font></font>
                </td>
                </tr>
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></td></tr>
                <tr>
                    <td class="NArialL">
                        Test Location:<font color=red>*</font>
                    </td>
                    <td class="NArialL">
                        <logic:equal name="actionType" value="new" >
                        <html:select name="assmReleaseForm" property="testLocation_id" styleClass="txfield" onchange="javascript:loadSelectedValues()" style="width:145px">
                            <html:option value="-1">--Select Location--</html:option>
                            <html:options collection="testLocation" property="value" labelProperty="label"/>
                        </html:select>
                        </logic:equal>
                        <logic:notEqual name="actionType" value="new">
                        <html:select name="assmReleaseForm" property="testLocation_id" styleClass="txfield" onchange="javascript:loadSelectedValues()" style="width:145px" disabled="true">
                            <html:option value="-1">--Select Location--</html:option>
                            <html:options collection="testLocation" property="value" labelProperty="label"/>
                        </html:select>
                        </logic:notEqual>
                    </td>
                    <td class="NArialL">
                        Test PO Number:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="testPONumber" styleClass="txfield" maxlength='50'/>
                    </td>
                </tr>
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></td></tr>
                <bean:size id="testSpecFileListSize" name="attachedSpecFileTestList"/>
                <logic:greaterThan name="testSpecFileListSize" value="0">
                <tr>
                    <td class="NArialL">
                        Select Spec File Name:
                    </td>
                    <td class="NArialL">
                       <%-- <logic:equal name="assmReleaseForm" property="requestType" value="PROD">
                            <html:select name="assmReleaseForm" property="fileAttachmentTestSpecFileId" styleClass="txfield" onchange="javascript:loadSelectedValues();"  style="width:200px"  disabled="true">
                                <html:option value="-1">--Select Spec File Name--</html:option>
                                <html:options collection="attachedSpecFileTestList" property="value" labelProperty="label"/>
                            </html:select>
                        </logic:equal>
                        <logic:notEqual name="assmReleaseForm" property="requestType" value="PROD">--%>
                            <html:select name="assmReleaseForm" property="fileAttachmentTestSpecFileId" styleClass="txfield" onchange="javascript:loadSelectedValues();"  style="width:200px">
                                <html:option value="-1">--Select Spec File Name--</html:option>
                                <html:options collection="attachedSpecFileTestList" property="value" labelProperty="label"/>
                            </html:select>
                       <%-- </logic:notEqual>--%>
                    </td>
                    <td class="NArialL">
                         Test Spec Rev:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="testRevisionNumber" styleClass="txfield" maxlength='50' disabled="true"/>
                    </td>
                </tr>
                </logic:greaterThan>
                <logic:equal name="testSpecFileListSize" value="0">
                <tr><td colspan="4" class="NArialL"><font color="red">Specification Information not found</font></td></tr>
                </logic:equal>

                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <tr>
                    <td class="NArialL">
                        Test Expected Start Date:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="testExpectedStartDate" styleClass="txfield"/>
                        <logic:notEqual name="assmReleaseForm" property="status" value="Closed" >
                            <logic:notEqual name="assmReleaseForm" property="status" value="CLOSED" >
                                <a href="javascript:openCalendar( document.assmReleaseForm.testExpectedStartDate )">
                                    <img onMouseOver="window.status='Click  to select date';return true" onMouseout="window.status='';return 	true" border="0" align='center' src="<%=chipTracContext%>/jsp/includes/images/date_selector.gif" height=20 width=20>
                                </a>
                            </logic:notEqual>
                        </logic:notEqual>
                    </td>
                    <td class="NArialL">&nbsp;</td>
                    <td class="NArialL">&nbsp;</td>
                </tr>
                <tr>
                    <td class="NArialL">
                        Test Special Instructions:
                    </td>
                    <td class="NArialL" colspan="3">
                        <html:textarea name="assmReleaseForm" property="testInstructions" styleClass="txfield" rows="4" cols="113"/>
                    </td>
                </tr>
                <%--</logic:equal>--%>

                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></td></tr>
                <%--<tr>
                    <td class="NArialL">
                        Test Spec:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="testSpecFileName" styleClass="txfield" maxlength='50' disabled="true"/>
                    </td>
                    <td class="NArialL">
                        Test Spec Rev:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="testRevisionNumber" styleClass="txfield" maxlength='50' disabled="true"/>
                    </td>
                </tr>--%>
                <%--<tr>
                    <td class="NArialL">
                        Test Program Name:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="testProgramName" styleClass="txfield" maxlength='50' disabled="true"/>
                    </td>
                    <td class="NArialL">
                        Test Program Rev No:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="testRevisionNumber" styleClass="txfield" maxlength='50' disabled="true"/>
                    </td>
                </tr>
                <tr>
                    <td class="NArialL">
                        Room Temp Test :
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="roomTestTemp" styleClass="txfield" maxlength='50' disabled="true"/>
                    </td>
                    <td class="NArialL">
                        Hot Temp Test :
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="hotTempTest" styleClass="txfield" maxlength='50' disabled="true"/>
                    </td>
                </tr>
                <tr>
                    <td class="NArialL">
                        QA Test:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="qaTest" styleClass="txfield" maxlength='50' disabled="true"/>
                    </td>
                    <td class="NArialL">
                        &nbsp;
                    </td>
                    <td class="NArialL">
                        &nbsp;
                    </td>
                </tr>
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></td></tr>
                <tr>
                    <td colspan="4" class="NArialL" width="100%"  align="left" bgcolor="#993333">
                        <font class="NArialL"><font color="#FFFFFF">Freight Carrier</font></font>
                    </td>
                </tr>
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></td></tr>
                <tr>
                    <td class="NArialL">
                        Freight Carrier:<font color=red>*</font>
                    </td>
                    <td class="NArialL">
                        <html:select name="assmReleaseForm" property="shipperId"  styleClass="txfield" style="width:145px">
                            <html:option value="-1">--Select--</html:option>
                            <html:optionsCollection name="assmReleaseForm" property="shippersList" value="value" label="label"/>
                        </html:select>
                    </td>
                    <td class="NArialL">
                        &nbsp;
                    </td>
                    <td class="NArialL">
                        &nbsp;
                    </td>
                </tr>--%>
                <logic:greaterThan name="assmReleaseForm" property="tapeReelQty" value="0">
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <tr>
                    <td colspan="4" class="NArialL" width="70%"  align="left" bgcolor="#993333">
                        <font class="NArialL"><font color="#FFFFFF">Reel Infomartion</font></font>
                    </td>
                </tr>
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <tr>
                    <td class="NArialL">
                        Reel Qty:
                    </td>
                    <td class="NArialL">
                        <html:text name="assmReleaseForm" property="tapeReelQty" styleClass="txfield" maxlength='50' disabled="true"/>
                    </td>
                    <td class="NArialL">
                        &nbsp;
                    </td>
                    <td class="NArialL">
                        &nbsp;
                    </td>
                </tr>
                </logic:greaterThan>
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <nested:nest property="shippingContactInfo">
                <tr>
                    <td colspan="4" class="NArialL" width="70%"  align="left" bgcolor="#993333">
                        <%--<font class="NArialL"><font color="#FFFFFF">Upon Completion, Please Ship to <bean:write name="assmReleaseForm" property="shipToProcess"/> Process Vendor <bean:write name="assmReleaseForm" property="shipToVendorName"/></font></font>--%>
                        <font class="NArialL"><font color="#FFFFFF">Upon Completion, Please Ship to Vendor <bean:write name="assmReleaseForm" property="shipToVendorName"/></font></font>
                        <html:hidden name="assmReleaseForm" property="shipperId" />
                    </td>
                </tr>
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='2'></td></tr>
                <tr>
                    <td class="NArialL">
                        After Completion Vendor:<font color=red>*</font>
                    </td>
                    <td class="NArialL">
                        <nested:select property="vendorId" styleClass="txfield" onchange="javascript:loadSelectedValues()" style="width:145px">
                            <html:option value="-1">--Select Vendor--</html:option>
                            <nested:optionsCollection property="locationsList" value="value"/>
                        </nested:select>
                    </td>
                    <td class="NArialL">
                        &nbsp;
                    </td>
                    <td class="NArialL">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td class="NArialL">
                        Contact Person:
                    </td>
                    <td class="NArialL">
                        <nested:hidden property="vendorName" />
                        <%--<nested:hidden property="vendorId" />--%>
                        <nested:text property="contactPerson" styleClass="txfield" disabled="true"/>
                    </td>
                    <td class="NArialL">
                        Email:
                    </td>
                    <td class="NArialL">
                        <nested:text property="email" styleClass="txfield" disabled="true"/>
                    </td>
                </tr>
                <tr>
                    <td class="NArialL">
                        Phone:
                    </td>
                    <td class="NArialL">
                        <nested:text property="phoneNumber" styleClass="txfield" disabled="true"/>
                    </td>
                    <td class="NArialL">
                        Fax:
                    </td>
                    <td class="NArialL">
                        <nested:text property="faxNumber" styleClass="txfield" disabled="true"/>
                    </td>
                </tr>
                <tr>
                    <td class="NArialL" align='left'>
                        Address1:
                    </td>
                    <td class="NArialL" align='left'>
                        <nested:text property="address1" styleClass="txfield" disabled="true"/>
                    </td>
                    <td class="NArialL" align='left'>
                        Address2:
                    </td>
                    <td class="NArialL" align='left'>
                        <nested:text property="address2" styleClass="txfield" disabled="true"/>
                    </td>
                </tr>
                <tr>
                    <td class="NArialL" align='left'>
                        Address3:
                    </td>
                    <td class="NArialL" align='left'>
                        <nested:text property="address3" styleClass="txfield" disabled="true"/>
                    </td>
                    <td class="NArialL" align='left'>
                        Address4:
                    </td>
                    <td class="NArialL" align='left'>
                        <nested:text property="address4" styleClass="txfield" disabled="true"/>
                    </td>
                </tr>
                <tr>
                    <td class="NArialL" align='left'>
                        City:
                    </td>
                    <td class="NArialL" align='left'>
                        <nested:text property="city" styleClass="txfield" disabled="true"/>
                    </td>
                    <td class="NArialL" align='left'>
                        State:
                    </td>
                    <td class="NArialL" align='left'>
                        <nested:text property="state" styleClass="txfield" disabled="true"/>
                    </td>
                </tr>
                <tr>
                    <td class="NArialL" align='left'>
                        Country:
                    </td>
                    <td class="NArialL" align='left'>
                        <nested:text property="country" styleClass="txfield" disabled="true"/>
                    </td>
                    <td class="NArialL" align='left'>
                        Zip:
                    </td>
                    <td class="NArialL" align='left'>
                        <nested:text property="zipCode" styleClass="txfield" disabled="true"/>
                    </td>
                </tr>
                </nested:nest>
                <tr>
                    <td class="NArialL">
                        Shipping Alerts:
                    </td>
                    <td class="NArialL" colspan="3">
                        <html:textarea name="assmReleaseForm" property="shipAlerts" styleClass="txfield" rows="4" cols="113" disabled='true'/>
                    </td>
                </tr>

                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='5'></td></tr>
                <tr><td colspan='4'><img src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" height='10'></td></tr>
                <tr>
                    <td colspan="4" align="center">
                    <chiptrack:restrictedLink functionality='<%=Functionality.ASSEMBLY_RELEASE %>' action='<%=User.USER_ACTION_MODIFY%>' href='javascript:submitPage();' onmouseover="window.status='Click to Save Assembly Release';return true" onmouseout="window.status='';return true">
                        <img border="0" src="<%=chipTracContext%>/jsp/includes/images/save.gif" title="Click here to Save Assembly Release"/>
                    </chiptrack:restrictedLink>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <a href="javascript:resetForm();"><img border="0" src="<%=chipTracContext%>/jsp/includes/images/reset.gif" width="53" height="17" onmouseover="window.status='Click to Reset';return true" onmouseout="window.status='';return true" title="Click here to Reset"></a>
                    </td>
                </tr>
		    </table>
	        </html:form>
			<%}catch(Exception e){e.printStackTrace();}%>
            <!-- till here -->
            <BR><BR><BR>
        </td>
        <td bgcolor="#ffffff"><img height=1 src="<%=chipTracContext%>/jsp/includes/images/spacer.gif" width=1></td>
    </tr>
</table>

<!-- Footer starts here -->
<%@ include file="/jsp/includes/footer.jsp" %>
<!-- footer end here -->

</BODY>
</HTML>
